package com.jp.knowledge.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.jp.knowledge.R;
import com.jp.knowledge.model.CommText;

import java.util.List;

/**
 * Created by jiayen on 16/11/24.
 */

public class SearchListIconAdapter extends  JpBaseRecyViewAdapter {
    public SearchListIconAdapter(Context context, List data) {
        super(context, data);
    }

    @Override
    public int getLayoutId() {
        return R.layout.comm_text;
    }

    @Override
    public void bindViewHold(JPRecycleViewHolder holder, int position) {
        ImageView icon  =holder.getView(R.id.icon);
        TextView name = holder.getView(R.id.name);
        CommText  commText = (CommText) getItem(position);
        icon.setImageResource(commText.getIcon());
        name.setText(commText.getName());
    }
}
